<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Data Driven Substructure: Covariance Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Data Driven Substructure
   
   </div>
   <div id="projectbrief">A library for carrying out Multivariate Kernel Smoothing--designed to be fast and flexible for large data processing.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">Covariance Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="Covariance" -->
<p>class for <a class="el" href="classCovariance.html" title="class for Covariance matrix">Covariance</a> matrix  
 <a href="classCovariance.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="covariance_8h_source.html">covariance.h</a>&gt;</code></p>

<p><a href="classCovariance-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1b0c75c17023f8e424b9f8424cbcd81e"></a><!-- doxytag: member="Covariance::Covariance" ref="a1b0c75c17023f8e424b9f8424cbcd81e" args="(int rank_=1)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a1b0c75c17023f8e424b9f8424cbcd81e">Covariance</a> (int rank_=1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">default constructor, supply the rank of matrix <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8b84948da6b3975d2ff5b0b0407b5479"></a><!-- doxytag: member="Covariance::Rank" ref="a8b84948da6b3975d2ff5b0b0407b5479" args="() const " -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a8b84948da6b3975d2ff5b0b0407b5479">Rank</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return rank of tensor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a6badcf066113d3bfcffaa348b71e97c2">ComputeBandwidth</a> (double min_size=-1.0, double extra_factor=1.0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a008c5f1f83738a72a82b2f52dce85321">BandwidthNorm</a> (const valarray&lt; double &gt; &amp;band, int power=-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f50b252023ce32fc0f9f0fd0f44edc6"></a><!-- doxytag: member="Covariance::Correlation" ref="a8f50b252023ce32fc0f9f0fd0f44edc6" args="(int row, int col) const " -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a8f50b252023ce32fc0f9f0fd0f44edc6">Correlation</a> (int row, int col) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">return correlation for variable at row and col <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#aee768d0462b8896ba627bb4f65e30d4a">operator()</a> (int row, int col) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a4543221389332dc122506d62cd7c5aee">Fill</a> (const valarray&lt; double &gt; &amp;ntuple, double weight=1.0)</td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">valarray&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a732bbc234570ac4aef769b114f833527">bandwidth</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">valarray&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#aae70b9ff34d641133e88d3d9300757c0">bandwidth_inverse</a></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">valarray&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a87ead41fd154645222bf12d449067886">ary2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa686e3c88a3824718dd0d017b73c8675"></a><!-- doxytag: member="Covariance::ary" ref="aa686e3c88a3824718dd0d017b73c8675" args="" -->
valarray&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#aa686e3c88a3824718dd0d017b73c8675">ary</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">stores sum of x <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab025c5f55a945fdf176414e3be8fa7cd"></a><!-- doxytag: member="Covariance::compute_bandwidth" ref="ab025c5f55a945fdf176414e3be8fa7cd" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#ab025c5f55a945fdf176414e3be8fa7cd">compute_bandwidth</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">used to keep track of whether bandwidth is computed <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19e0d1afb0808d61305b60b4f418ee47"></a><!-- doxytag: member="Covariance::rank" ref="a19e0d1afb0808d61305b60b4f418ee47" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a19e0d1afb0808d61305b60b4f418ee47">rank</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">rank of matrix (not the same as tensor rank) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a153d50863ab5337b6acb6354bd96a1cf"></a><!-- doxytag: member="Covariance::sum" ref="a153d50863ab5337b6acb6354bd96a1cf" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a153d50863ab5337b6acb6354bd96a1cf">sum</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">sum of weights or number of entries in covariance matrix <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#aca14b94adb91498ed1e98280526091af">sum2</a></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef648af6c56fa8ee0738c93629e725dc"></a><!-- doxytag: member="Covariance::DataSet" ref="aef648af6c56fa8ee0738c93629e725dc" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>DataSet</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ce7749c8ffc0acbea76638d324460a6"></a><!-- doxytag: member="Covariance::operator&lt;&lt;" ref="a2ce7749c8ffc0acbea76638d324460a6" args="(ostream &amp;, const Covariance &amp;)" -->
ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCovariance.html#a2ce7749c8ffc0acbea76638d324460a6">operator&lt;&lt;</a> (ostream &amp;, const <a class="el" href="classCovariance.html">Covariance</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">streaming operator for printing matrices <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>class for <a class="el" href="classCovariance.html" title="class for Covariance matrix">Covariance</a> matrix </p>
<p>Implementation of 2D symmetric square matrix via valarray, used to store and compute covariance matrix of multiple variables </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a008c5f1f83738a72a82b2f52dce85321"></a><!-- doxytag: member="Covariance::BandwidthNorm" ref="a008c5f1f83738a72a82b2f52dce85321" args="(const valarray&lt; double &gt; &amp;band, int power=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classCovariance.html#a008c5f1f83738a72a82b2f52dce85321">Covariance::BandwidthNorm</a> </td>
          <td>(</td>
          <td class="paramtype">const valarray&lt; double &gt; &amp;&#160;</td>
          <td class="paramname"><em>band</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>power</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>compute double^T*bandwidth^(2*power)*double*0.5 using valarry to enforce safety </p>

</div>
</div>
<a class="anchor" id="a6badcf066113d3bfcffaa348b71e97c2"></a><!-- doxytag: member="Covariance::ComputeBandwidth" ref="a6badcf066113d3bfcffaa348b71e97c2" args="(double min_size=&#45;1.0, double extra_factor=1.0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classCovariance.html#a6badcf066113d3bfcffaa348b71e97c2">Covariance::ComputeBandwidth</a> </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>min_size</em> = <code>-1.0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>extra_factor</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Compute Bandwidth Matrix using Silverman's Rule argument determines the minimum smoothing size this will automatically modify error computations </p>

</div>
</div>
<a class="anchor" id="a4543221389332dc122506d62cd7c5aee"></a><!-- doxytag: member="Covariance::Fill" ref="a4543221389332dc122506d62cd7c5aee" args="(const valarray&lt; double &gt; &amp;ntuple, double weight=1.0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classCovariance.html#a4543221389332dc122506d62cd7c5aee">Covariance::Fill</a> </td>
          <td>(</td>
          <td class="paramtype">const valarray&lt; double &gt; &amp;&#160;</td>
          <td class="paramname"><em>ntuple</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>weight</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>fill covariance with entry and weight valarray is used to enforce safety </p>

</div>
</div>
<a class="anchor" id="aee768d0462b8896ba627bb4f65e30d4a"></a><!-- doxytag: member="Covariance::operator()" ref="aee768d0462b8896ba627bb4f65e30d4a" args="(int row, int col) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double Covariance::operator() </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>row</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>col</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return covariance matrix elements this DOES NOT access elements of ary </p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a87ead41fd154645222bf12d449067886"></a><!-- doxytag: member="Covariance::ary2" ref="a87ead41fd154645222bf12d449067886" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">valarray&lt;double&gt; <a class="el" href="classCovariance.html#a87ead41fd154645222bf12d449067886">Covariance::ary2</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>valarray implementation for 2D matrix stores sum of xy this is NOT the same as the covariance matrix </p>

</div>
</div>
<a class="anchor" id="a732bbc234570ac4aef769b114f833527"></a><!-- doxytag: member="Covariance::bandwidth" ref="a732bbc234570ac4aef769b114f833527" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">valarray&lt;double&gt; <a class="el" href="classCovariance.html#a732bbc234570ac4aef769b114f833527">Covariance::bandwidth</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>bandwidth matrix^2 computed from ary2 done using Silverman's Rule of Thumb </p>

</div>
</div>
<a class="anchor" id="aae70b9ff34d641133e88d3d9300757c0"></a><!-- doxytag: member="Covariance::bandwidth_inverse" ref="aae70b9ff34d641133e88d3d9300757c0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">valarray&lt;double&gt; <a class="el" href="classCovariance.html#aae70b9ff34d641133e88d3d9300757c0">Covariance::bandwidth_inverse</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>bandwidth inverse^2 done using Silverman's Rule of Thumb in computation, bandwidth_inverse is used instead of bandwidth </p>

</div>
</div>
<a class="anchor" id="aca14b94adb91498ed1e98280526091af"></a><!-- doxytag: member="Covariance::sum2" ref="aca14b94adb91498ed1e98280526091af" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classCovariance.html#aca14b94adb91498ed1e98280526091af">Covariance::sum2</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>sum of weights^2 or (number of entries)^2 in covariance matrix coefficient for variance computation computed in ComputeBandwidth </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="covariance_8h_source.html">covariance.h</a></li>
<li>covariance.c</li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Sep 12 2013 17:12:58 for Data Driven Substructure by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
